home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
- PRODUCT : Delphi NUMBER : 2805
- VERSION : All
- OS : Windows
- DATE : May 31, 1995 PAGE : 1/1
-
- TITLE : Getting the Line number in a memo Field
-
-
-
-
- How do you figure out what line number you are currently
- on with a TMemo control?
-
- The trick is to use the em_LineFromChar message. Try this:
-
- procedure TMyForm.BitBtn1Click(Sender: TObject);
- var
- iLine : Integer ;
- begin
- iLine := Memo1.Perform(em_LineFromChar, $FFFF, 0);
- { Note: First line is zero }
- messageDlg('Line Number: ' + IntToStr(iLine), mtInformation,
- [mbOK], 0 ) ;
- end;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DISCLAIMER: You have the right to use this technical information
- subject to the terms of the No-Nonsense License Statement that
- you received with the Borland product to which this information
- pertains.
-